<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目列表</title>
<%@include file="../public.jsp"%>
<script src="<%=path %>/js/project/project.js"></script>
</head>
<body>
	<%@include file="../head.jsp"%>
	<%@include file="../menu.jsp"%>
	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
		<div class="row">
			<ol class="breadcrumb">
				<li><a href="<%=path %>/index"><span
						class="glyphicon glyphicon-home"></span></a></li>
				<li class="active">项目列表</li>
			</ol>
		</div>
		<!--/.row-->
	</div>
	<!--/.main-->
	<br>
	<br>
	<br>
	<br>
	<!-- 搜索框 -->
	<div class="container">
		<div class="col-lg-6">
			<div class="input-group"
				style="position: absolute; margin-left: 100px;">
				<input type="text" class="form-control" id="condition"
					name="condition" value="${condition}"> <span
					class="input-group-btn"> <a class="btn btn-primary"
					id="searchPro">搜索</a>
				</span>
			</div>
		</div>
		<!-- end -->

		<!-- 添加项目的按钮 -->
		<button class="btn btn-success" type="button" data-toggle="modal"
			data-target="#addProModal"
			style="position: absolute; margin-left: 400px">新增</button>
		<!-- end -->
<!--<a href="<%=path %>/test">test</a>  -->
		<!-- 添加Project弹窗-->
		<div class="modal fade" id="addProModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog" style="width: 700px; height: 500px;">
				<form action="<%=path %>/project/save" id="addProForm" method="post">
					<div class="modal-content">

						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel" align="center">
								创建工程</h4>
						</div>

						<div class="modal-body"
							style="overflow-y: auto; width: 697px; height: 400px;">
							<input type="hidden" id="userId" name="createBy"
								value="${user.id}">
							<dl class="dl-horizontal" style="float: left;">
								<dt>项目名称</dt>
								<dd>
									<div style="width: 350px;">
										<input type="text" id="pro_name" class="form-control"
											name="name" required="required" onblur="post(pro_name)"
											placeholder="请输入工程名"><span id="pro_name1"
											style="color: red;"></span><br>
									</div>
								</dd>

								<dt>仅生成文档</dt>
								<dd>
									<div style="width: 350px;">
										<input type="checkbox" id="textOnly" name="textOnly"><br><br>
									</div>
								</dd>
									
								<dt>根路径</dt>
								<dd>
									<input type="text" class="form-control" id="root1" name="rootUrl"
									placeholder="ip:端口号" title="项目启动才可以swagger测试"><br>
								</dd>
									
								<dt>编码</dt>
								<dd>
									<input type="text" class="form-control" id="pro_code"
										name="code" required="required"
										placeholder="请输入18位以下小写字母，例如:code。"
										onblur="checkStyle(pro_code)"><span id="pro_code1"
										style="color: red;"></span><br>
								</dd>

								<dt>版本</dt>
								<dd>
									<input type="text" class="form-control" name="version"
										required="required" placeholder="例如:v1.0.0, v1.0, 1.0.0, 1.0"><br>
								</dd>
								<div id="package">
								<dt>包名</dt>
								<dd>
									<input type="text" class="form-control" id="pro_packageName"
										name="packageName" placeholder="例如：com.bonc.apicreator"
										onblur="checkPackage(pro_packageName)"><span
										id="pro_packageName1" style="color: red;"></span><br>
								</dd>
								</div>
								<dt>描述</dt>
								<dd>
									<textarea class="form-control" rows="4" name="description"
										required="required" placeholder="介绍一下你创建的工程"></textarea>
									<br>
								</dd>
								<div id="data">
								<dt>
									<label for="name">数据源</label>
								</dt>
								<dd>
									<select class="form-control" name="dataCenterType" id="dataType" onchange="javascript:doit();">
										<!-- <option selected="selected">hbase</option>
										<option>mysql</option>
										<option>redis</option> -->
										<option>请选择数据源</option>
										<option>hbase</option>
										<option>mysql</option>
										<option>redis</option>
										<option>oracle</option>
									</select><br>
								</dd>
								<dt>环境</dt>
								<dd>
								开发环境<input type="radio" name="properties" value="dev">正式环境<input type="radio" name="properties" value="profile">
								<br><br>
								</dd>
								</div>
								<!-- hbase的输入参数 -->
								<div id="hbase_param">
								<dt>zkQuorum</dt>
								<dd>
									<input type="text" class="form-control" name="zkQuorum" id="URL"
									onblur="checkURL(URL)" placeholder="例如：127.0.0.1">
									<span id="URL1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkClientPort</dt>
								<dd>
									<input type="text" class="form-control" name="zkClientPort" id="zkClientPort"
									onblur="checkPort(zkClientPort)" placeholder="例如：2181">
									<span id="zkClientPort1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkParent</dt>
								<dd>
									<input type="text" class="form-control" name="zkParent" id="Parent"
									onblur="checkParent(Parent)" placeholder="/hbase_aai">
									<span id="Parent1" style="color: red;"></span><br>
								</dd>
								</div>
								<!-- hbase正式环境 -->
								<div id="hbase_param_profile">
								<dt>zkQuorum_profile</dt>
								<dd>
									<input type="text" class="form-control" name="zkQuorum_profile" id="URL_profile"
									onblur="checkURL(URL)" placeholder="例如：127.0.0.1">
									<span id="URL1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkClientPort_profile</dt>
								<dd>
									<input type="text" class="form-control" name="zkClientPort_profile" id="zkClientPort_profile"
									onblur="checkPort(zkClientPort)" placeholder="例如：2181">
									<span id="zkClientPort1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkParent_profile</dt>
								<dd>
									<input type="text" class="form-control" name="zkParent_profile" id="Parent_profile"
									onblur="checkParent(Parent)" placeholder="/hbase_aai">
									<span id="Parent1" style="color: red;"></span><br>
								</dd>
								</div>
								
								
								<!-- mysql的输入参数 -->
								<div id="mysql_param">
								<dt>mysqlURL</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUrl" id="mysqlUrl"
									placeholder="例如：127.0.0.1">
									<br>
								</dd>
								
								<dt>mysqlUsername</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUsername" id="mysqlUsername"
									 placeholder="例如：root">
									<br>
								</dd>
								
								<dt>mysqlPassword</dt>
								<dd>
									<input type="password" class="form-control" name="mysqlPassword" id="mysqlPassword"
									 placeholder="">
									<br>
								</dd>
								</div>
								
								<!-- mysql的profile参数 -->
								<div id="mysql_param_profile">
								<dt>mysqlURL_profile</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUrl_profile" id="mysqlUrl_profile"
									placeholder="例如：127.0.0.1">
									<br>
								</dd>
								
								<dt>mysqlUsername_profile</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUsername_profile" id="mysqlUsername_profile"
									 placeholder="例如：root">
									<br>
								</dd>
								
								<dt>mysqlPassword_profile</dt>
								<dd>
									<input type="password" class="form-control" name="mysqlPassword_profile" id="mysqlPassword_profile"
									 placeholder="">
									<br>
								</dd>
								</div>
								
								<!-- redis参数 -->
								<div id="redis_param">
								<dt>redisIp</dt>
								<dd>
									<input type="text" class="form-control" name="redisIp" id="redis_Ip"
									onblur="checkURL(redis_Ip)" placeholder="例如：127.0.0.1">
									<span id="redis_Ip1" style="color: red;"></span><br>
								</dd>
								
								<dt>redisPort</dt>
								<dd>
									<input type="text" class="form-control" name="redisPort" id="redis_Port"
									onblur="checkPort(redis_Port)" placeholder="例如：2181">
									<span id="redis_Port1" style="color: red;"></span><br>
								</dd>
								
								<dt>redisParent</dt>
								<dd>
									<input type="text" class="form-control" name="redisParent" id="redis_Parent"
									onblur="checkParent(redis_Parent)" placeholder="/redis_aai">
									<span id="redis_Parent1" style="color: red;"></span><br>
								</dd>
								</div>
								
								<!-- redis正式环境 -->
								<div id="redis_param_profile">
								<dt>redisIp_profile</dt>
								<dd>
									<input type="text" class="form-control" name="redisIp_profile" id="redis_Ip_profile"
									onblur="checkURL(redis_Ip)" placeholder="例如：127.0.0.1">
									<span id="redis_Ip1" style="color: red;"></span><br>
								</dd>
								
								<dt>redisPort_profile</dt>
								<dd>
									<input type="text" class="form-control" name="redisPort_profile" id="redis_Port_profile"
									onblur="checkPort(redis_Port)" placeholder="例如：2181">
									<span id="redis_Port1" style="color: red;"></span><br>
								</dd>
								
								<dt>redisParent_profile</dt>
								<dd>
									<input type="text" class="form-control" name="redisParent_profile" id="redis_Parent_profile"
									onblur="checkParent(redis_Parent)" placeholder="/redis_aai">
									<span id="redis_Parent1" style="color: red;"></span><br>
								</dd>
								</div>
								
								<!-- oracle参数 -->
								<div id="oracle_param">
								<dt>jdbcUrl</dt>
								<dd>
									<input type="text" class="form-control" name="jdbcUrl" id="oracle_jdbcUrl"
									placeholder="例如：jdbc:oracle:thin:@localhost:1521:orcl"><br>
								</dd>
								
								<dt>username</dt>
								<dd>
									<input type="text" class="form-control" name="oracleUsername" id="oracle_username"
									placeholder="例如：scott"><br>
								</dd>
								
								<dt>password</dt>
								<dd>
									<input type="password" class="form-control" name="oraclePassword" id="oracle_password">
									<br>
								</dd>
								</div>
								
								<!-- oracle正式环境 -->
								<div id="oracle_param_profile">
								<dt>jdbcUrl_profile</dt>
								<dd>
									<input type="text" class="form-control" name="jdbcUrl_profile" id="oracle_jdbcUrl_profile"
									placeholder="例如：jdbc:oracle:thin:@localhost:1521:orcl"><br>
								</dd>
								
								<dt>username_profile</dt>
								<dd>
									<input type="text" class="form-control" name="oracleUsername_profile" id="oracle_username_profile"
									placeholder="例如：scott"><br>
								</dd>
								
								<dt>password_profile</dt>
								<dd>
									<input type="password" class="form-control" name="oraclePassword_profile" id="oracle_password_profile">
									<br>
								</dd>
								</div>
							</dl>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="submit" class="btn btn-primary">保存</button>
						</div>

					</div>
					<!-- /.modal-content -->
				</form>
			</div>
		</div>
		<!-- /.modal -->
		<!-- end -->

		<!-- 更新Project弹窗-->
		<div class="modal fade" id="updateProModal" tabindex="-1"
			role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog" style="width: 700px; height: 500px;">
				<form action="<%=path %>/project/update" id="updateProForm"
					method="post">
					<div class="modal-content">

						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">&times;</button>
							<h4 class="modal-title" id="myModalLabel" align="center">
								更新工程信息</h4>
						</div>

						<div class="modal-body"
							style="overflow-y: auto; width: 697px; height: 400px;">
							<input type="hidden" id="proId" name="id" value=""> <input
								type="hidden" id="userId" name="updateBy" value="${user.id}">

							<dl class="dl-horizontal" style="float: left;">
								<dt>项目名称</dt>
								<dd>
									<div style="width: 350px;">
										<input type="text" class="form-control" id="name" name="name"
											required="required"><br>
									</div>
								</dd>
								
								<div id="root">
								<dt>根路径</dt>
								<dd>
									<input type="text" class="form-control" id="rootUrl" name="rootUrl"><br>
								</dd>
								</div>

								<dt>编码</dt>
								<dd>
									<input type="text" class="form-control" id="code" name="code"
										required="required"><br>
								</dd>
								<!-- <dt>上下文路径</dt>
			  <dd><input type="text" class="form-control" id="context" name="context" required="required" disabled="disabled"><br></dd> -->

								<dt>版本</dt>
								<dd>
									<input type="text" class="form-control" id="version"
										name="version" required="required"><br>
								</dd>
								<div id="update_package">
								<dt>包名</dt>
								<dd>
									<input type="text" class="form-control" id="packageName"
										name="packageName" placeholder="例如：com.bonc.apicreator"
										onblur="checkPackage(packageName)"><span
										id="packageName1" style="color: red;"></span><br>
								</dd>
								</div>
								<dt>描述</dt>
								<dd>
									<textarea class="form-control" rows="4" id="description"
										name="description" required="required"></textarea>
									<br>
								</dd>
								<div id="update_data">
								<dt>
									<label for="name">数据源</label>
								</dt>
								<dd>
									<select class="form-control" name="dataCenterType"
										id="dataCenterType" onchange="javascript:doit1();">
										<option>hbase</option>
										<option>mysql</option>
										<option>redis</option>
										<option>oracle</option>
									</select><br>
								</dd>
								<dt>环境</dt>
								<dd>
								开发环境<input type="radio" name="update_properties" value="dev" checked="checked">正式环境<input type="radio" name="update_properties" value="profile">
								<br><br>
								</dd>
								</div>
<div id="update_hbase">
								<dt>zkQuorum</dt>
								<dd>
									<input type="text" class="form-control" id="zkQuorum"
									name="zkQuorum" onblur="checkURL(zkQuorum)" placeholder="例如：127.0.0.1">
									<span id="zkQuorum1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkClientPort</dt>
								<dd>
									<input type="text" class="form-control" name="zkClientPort" id="zkPort"
									onblur="checkPort(zkPort)" placeholder="例如：2181">
									<span id="zkPort1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkParent</dt>
								<dd>
									<input type="text" class="form-control" name="zkParent" id="zkParent"
									onblur="checkParent(Parent)" placeholder="/hbase_aai">
									<span id="Parent1" style="color: red;"></span><br>
								</dd>
</div>

<div id="update_hbase_profile">
								<dt>zkQuorum_profile</dt>
								<dd>
									<input type="text" class="form-control" id="zkQuorum_profile"
									name="zkQuorum_profile" onblur="checkURL(zkQuorum)" placeholder="例如：127.0.0.1">
									<span id="zkQuorum1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkClientPort_profile</dt>
								<dd>
									<input type="text" class="form-control" name="zkClientPort_profile" id="zkPort_profile"
									onblur="checkPort(zkPort)" placeholder="例如：2181">
									<span id="zkPort1" style="color: red;"></span><br>
								</dd>
								
								<dt>zkParent_profile</dt>
								<dd>
									<input type="text" class="form-control" name="zkParent_profile" id="zkParent_profile"
									onblur="checkParent(Parent)" placeholder="/hbase_aai">
									<span id="Parent1" style="color: red;"></span><br>
								</dd>
</div>


<div id="update_mysql">
								<dt>mysqlURL</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUrl" id="mysqlUrl_update"
									placeholder="例如：127.0.0.1">
									<br>
								</dd>
								
								<dt>mysqlUsername</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUsername" id="mysqlUsername_update"
									 placeholder="例如：root">
									<br>
								</dd>
								
								<dt>mysqlPassword</dt>
								<dd>
									<input type="password" class="form-control" name="mysqlPassword" id="mysqlPassword_update">
									<br>
								</dd>
</div>

<div id="update_mysql_profile">
								<dt>mysqlURL_profile</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUrl_profile" id="mysqlUrl_update_profile"
									placeholder="例如：127.0.0.1">
									<br>
								</dd>
								
								<dt>mysqlUsername_profile</dt>
								<dd>
									<input type="text" class="form-control" name="mysqlUsername_profile" id="mysqlUsername_update_profile"
									 placeholder="例如：root">
									<br>
								</dd>
								
								<dt>mysqlPassword_profile</dt>
								<dd>
									<input type="password" class="form-control" name="mysqlPassword_profile" id="mysqlPassword_update_profile">
									<br>
								</dd>
</div>

<div id="update_redis">
								<dt>redisIp</dt>
								<dd>
									<input type="text" class="form-control" name="redisIp" id="redisIp_update"
									placeholder="例如：127.0.0.1">
									<br>
								</dd>
								
								<dt>redisPort</dt>
								<dd>
									<input type="text" class="form-control" name="redisPort" id="redisPort_update"
									 placeholder="例如：2181">
									<br>
								</dd>
								
								<dt>redisParent</dt>
								<dd>
									<input type="text" class="form-control" name="redisParent" id="redisParent_update"
									 placeholder="/redis_aai">
									<br>
								</dd>
</div>

<div id="update_redis_profile">
								<dt>redisIp_profile</dt>
								<dd>
									<input type="text" class="form-control" name="redisIp_profile" id="redisIp_update_profile"
									placeholder="例如：127.0.0.1">
									<br>
								</dd>
								
								<dt>redisPort_profile</dt>
								<dd>
									<input type="text" class="form-control" name="redisPort_profile" id="redisPort_update_profile"
									 placeholder="例如：2181">
									<br>
								</dd>
								
								<dt>redisParent_profile</dt>
								<dd>
									<input type="text" class="form-control" name="redisParent_profile" id="redisParent_update_profile"
									 placeholder="/redis_aai">
									<br>
								</dd>
</div>

<div id="update_oracle">
								<dt>jdbcUrl</dt>
								<dd>
									<input type="text" class="form-control" name="jdbcUrl" id="jdbcUrl_update"
									placeholder="例如：jdbc:oracle:thin:@localhost:1521:orcl">
									<br>
								</dd>
								
								<dt>username</dt>
								<dd>
									<input type="text" class="form-control" name="oracleUsername" id="oracleUsername_update"
									 placeholder="例如：scott">
									<br>
								</dd>
								
								<dt>password</dt>
								<dd>
									<input type="password" class="form-control" name="oraclePassword" id="oraclePassword_update">
									<br>
								</dd>
</div>

<div id="update_oracle_profile">
								<dt>jdbcUrl_profile</dt>
								<dd>
									<input type="text" class="form-control" name="jdbcUrl_profile" id="jdbcUrl_update_profile"
									placeholder="例如：jdbc:oracle:thin:@localhost:1521:orcl">
									<br>
								</dd>
								
								<dt>username_profile</dt>
								<dd>
									<input type="text" class="form-control" name="oracleUsername_profile" id="oracleUsername_update_profile"
									 placeholder="例如：scott">
									<br>
								</dd>
								
								<dt>password_profile</dt>
								<dd>
									<input type="password" class="form-control" name="oraclePassword_profile" id="oraclePassword_update_profile">
									<br>
								</dd>
</div>
								<!-- 
			  <dt>hbase_账号</dt>
			  <dd><input type="text" class="form-control" id="hbaseUsername" name="hbaseUsername" required="required"><br></dd>
			  
			  <dt>hbase_密码</dt>
			  <dd><input type="password" class="form-control" id="hbasePassword" name="hbasePassword" required="required"><br></dd> -->
							</dl>
						</div>

						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div>
					<!-- /.modal-content -->
				</form>
			</div>
		</div>
		<!-- /.modal -->
		<!-- end -->

		<br>
		<br>
		<br>

		<!-- 表格 -->
		<div class="ProList" align="center" >
		<table class="table table-bordered" style="width: 80%" align="center">
				<thead>
					<tr>
						<th style="width: 5%">#</th>
						<th style="width: 23%">名称</th>
						<th style="width: 15%">编码</th>
						<!-- <th style="width: 10%">上下文路径</th> -->
						<th style="width: 10%">版本</th>
						<!-- <th style="width: 15%">描述</th> -->
						<th style="width: 20%">创建时间</th>
						<th style="width: 27%">操作</th>
					</tr>
				</thead>
				<tbody id="proList">

				</tbody>
			</table>
			<div id="pagination" style="position: relative;margin-left: 120px;"></div>
		</div>
	</div>
</body>
</html>